package com.whfc.emp.dao;

import com.whfc.emp.dto.AppTrainingUserAnswerDTO;
import com.whfc.emp.entity.AppTrainingUserAnswers;
import com.whfc.emp.param.AppTrainingUserAnswersListParam;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author: hw
 * @date: 2021-10-22 15:24
 * @description: //todo
 */
public interface AppTrainUserAnswerMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(AppTrainingUserAnswers record);

    int insertSelective(AppTrainingUserAnswers record);

    AppTrainingUserAnswers selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(AppTrainingUserAnswers record);

    int updateByPrimaryKey(AppTrainingUserAnswers record);

    /**
     * 获取培训列表
     *
     * @param request
     * @return
     */
    List<AppTrainingUserAnswerDTO> selectByParam(AppTrainingUserAnswersListParam request);

    /**
     * 删除培训记录
     *
     * @param trainId
     */
    void deleteLogicById(@Param("trianId") Integer trainId);

    /**
     * 获取培训记录试题
     *
     * @param questionId
     * @param userId
     * @param trainingId
     * @return
     */
    AppTrainingUserAnswers getAnswerByQuestionIdAndUserId(@Param("questionId") Long questionId,@Param("userId") Integer userId,@Param("trainingId") Long trainingId);
}